const {app, BrowserWindow} = require('electron')
const {create: createMainWindow, show: showMainWindow,  close: closeMainWindow} = require('./windows/main')
const ipc = require('./ipc')

app.on('ready', ()=>{
    createMainWindow()
    ipc()
})

app.on('second-instance', (event, commandLine, workingDirectory) => {
    // 当运行第二个实例时,将会聚焦到mainWindow这个窗口
    showMainWindow()
})

app.on('activate', () => {
    // process.crash()
    showMainWindow()
})

app.on('before-quit', () => {
    closeMainWindow()
})


